#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/wait.h>

int main()
{   
    int status;
    printf("Hello World\n");
    char *argv[] = {"ping", "-c","30","www.baidu.com", NULL};
    pid_t pid = fork();
    if (pid==-1)
    {
        perror("fork");
    }else if (pid==0)
    {
        execve("/usr/bin/ping", argv, NULL);
    }else{
        
        waitpid(pid, &status, 0);
        printf("Child process terminated with status %d\n", status);
    }
    
    
}
